package com.zhengbing.tj.data.complexity;

/**
 * O(n^2) 时间复杂度示例：平方时间操作
 *
 * @author zhengbing
 * @date 2025-07-22
 */
public class QuadraticDemo {
    public int countPairs(int[] arr) {
        int count = 0;
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr.length; j++) {
                if (arr[i] < arr[j]) count++;
            }
        }
        return count;
    }
} 